<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.util.ParamUtil"%>
<%@page import="com.is.model.User"%>
<%@page import="com.is.control.UserControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%  
	String name= ParamUtil.getString(request,"add_name","未填写");
	String userName = ParamUtil.getString(request,"add_username","未填写");
	String passWord = ParamUtil.getString(request,"add_password","123456");
	String role = ParamUtil.getString(request,"add_role","1");
	String picUrl = ParamUtil.getString(request,"add_picPath","");
	String sex = ParamUtil.getString(request,"add_sex","1");
	String position = ParamUtil.getString(request,"add_position","无");
	String political = ParamUtil.getString(request,"add_political","无");
	String birthday = ParamUtil.getString(request,"add_birthday","1990-02-05");
	String eduLevel = ParamUtil.getString(request,"add_edulevel","研究生");
	String email = ParamUtil.getString(request,"add_email","null@163.com");
	String phone = ParamUtil.getString(request,"add_phone","1894*******");
	String professional = ParamUtil.getString(request,"add_professional","好");
	User u = new User();
	u.setName(name);
	u.setUsername(userName);
	u.setPassword(passWord);
	u.setRole(role);
	u.setPicUrl(picUrl);
	u.setSex(sex);
	u.setPosition(position);
	u.setPolitical(political);
	u.setBirthday(birthday);
	u.setEduLevel(eduLevel);
	u.setEmail(email);
	u.setPhone(phone);
	u.setProfessionalSkill(professional);
	if(UserControl.insertUser(u)){
%>
<script type="text/javascript">
	//alert("添加用户成功！");
	window.location.href="user_all.jsp";
</script>
<% 
	} else{
%>
<script type="text/javascript">
	alert("添加新用户失败");
	window.location.href="user_all.jsp";
</script>
<%	
	}
%>
</body>
</html>